package cuiyt.leetcode.dichotomy.demoa;

/**
 * @author cyt
 * @create 2020-09-06 15:31
 */
public class Tc {

    public static void main(String[] args) {

    }

    public int guessNumber(int n) {
        int l = 0;
        int r = n;
        while (l <= r) {
            int mid = l + (r - l) / 2;
            if (guess(mid) == 0) {
                return mid;
            } else if (guess(mid) == 1) {
                l = mid + 1;
            } else {
                r = mid - 1;
            }
        }
        return -1;
    }


    int guess(int x) {
        return 0;
    }
}
